package com.qf.utils;

import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;

/**
 * @author 郗昊天
 * @version 1.0
 * @package com.qf.utils
 * @date 2022/10/14 20:21
 */
public class ConnectionUtils {

    public static Connection getconnection() throws Exception{
        ConnectionFactory connectionFactory = new ConnectionFactory();
        connectionFactory.setVirtualHost("/test4");
        connectionFactory.setHost("10.9.12.200");
        connectionFactory.setPort(9090);
        connectionFactory.setUsername("xht");
        connectionFactory.setPassword("xht");

        return connectionFactory.newConnection();
    }
}
